package org.cuit.epoch.seon.combat;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Seon
 * @version 1.0
 * @since 2024-09-18
 */
public class Directory implements FileSystemComponent {

    private final String name;
    private final List<FileSystemComponent> children;

    public Directory(String name) {
        this.name = name;
        children = new ArrayList<>();
    }

    @Override
    public void showDetails() {
        System.out.println("Directory: " + name);
        for (FileSystemComponent child : children) {
            child.showDetails();
        }
    }

    @Override
    public void add(FileSystemComponent component) {
        children.add(component);
    }

    @Override
    public void remove(FileSystemComponent component) {
        children.remove(component);
    }
}
